<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('transacciones/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<a href="<?php echo url_for('transacciones/index') ?>">Back to list</a>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('Delete', 'transacciones/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Save" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
      	<th>Cuenta</th>
      	<td><?php echo  $cuenta->getId() ?></td>
      </tr>
      <tr>
      	<th>Modulo</th>
      	<td><?php echo $modulo ?></td>
      </tr>
      <tr>
      	<th>Tipo</th>
      	<td><?php echo $tipo ?></td>
      </tr>
      
      <tr>
        <th><?php echo $form['monto']->renderLabel() ?></th>
        <td>
          <?php echo $form['monto']->renderError() ?>
          <?php echo $form['monto'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['glosa']->renderLabel() ?></th>
        <td>
          <?php echo $form['glosa']->renderError() ?>
          <?php echo $form['glosa'] ?>
        </td>
      </tr>
    </tbody>
  </table>
  
  <?php if ($compra != 0): ?>
  <input type="hidden" name="transaccion[cuenta_id]" value="<?php echo $compra->getCuentaId() ?>">
  <input type="hidden" name="transaccion[compra_id]" value="<?php echo $compra->getId() ?>">
  <?php else: ?>
  <input type="hidden" name="transaccion[cuenta_id]" value="<?php echo $cuenta->getId() ?>">
  <?php endif; ?>
  <input type="hidden" name="transaccion[modulo]" value="<?php echo $modulo ?>">
  <input type="hidden" name="transaccion[tipo]" value="<?php echo $tipo ?>">
</form>
